package com.ymttest.database.mongo;

import java.util.ArrayList;
import java.util.Map;

import com.ymt.database.MongoDBDriver;

public class ProductCoreInfoWapper {
	
	MongoDBDriver mdd = YmtMongoDriverFactroy.getInstance_ProductSnapshotDBdriverNew("ProductCoreInfo");

	public ProductCoreInfoWapper()  {
	}
		

	@SuppressWarnings({ "rawtypes", "unchecked" })
	public Map<String,Object> getProductCoreInfoByPkey(String pkey) throws Exception {
		ArrayList<Map> list = mdd.selectPartLimitToMap("{\"pkey\":\"" + pkey + "\"}" ,1);
	    
	    return list.size()>0?list.get(0):null;
	}

	public static void main(String[] args) throws Exception {
		ProductCoreInfoWapper wapper = new ProductCoreInfoWapper();
		System.out.println(wapper.getProductCoreInfoByPkey("dfba1904-7507-45ef-89c0-c34b0742d7b9").get("pkey").toString());
	}
}
